home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form Form1 Caption = "BitBlt Tester" ClientHeight = 5685 ClientLeft = 810 ClientTop = 1515 ClientWidth = 9150 Height = 6090 Icon = BITBLT.FRX:0000 Left = 750 LinkTopic = "Form1" ScaleHeight = 379 ScaleMode = 3 'Pixel ScaleWidth = 610 Top = 1170 Width = 9270 Begin ComboBox Combo1 Height = 288 Left = 5520 Style = 2 'Dropdown List TabIndex = 7 Top = 360 Width = 1932 End Begin CommandButton Command3 Caption = "EXECUTE BitBlt" Height = 492 Left = 240 TabIndex = 0 Top = 2280 Width = 3252 End Begin CommandButton Command5 Caption = "Hide" Height = 492 Left = 2280 TabIndex = 13 Top = 960 Width = 612 End Begin CommandButton Command4 Caption = "Draw Print Regions" Height = 492 Left = 240 TabIndex = 12 Top = 960 Width = 1932 End Begin TextBox Text8 Height = 372 Left = 4560 TabIndex = 6 Text = "30" Top = 360 Width = 612 End Begin TextBox Text7 Height = 372 Left = 3840 TabIndex = 5 Text = "20" Top = 360 Width = 612 End Begin TextBox Text6 Height = 372 Left = 2760 TabIndex = 4 Text = "110" Top = 360 Width = 612 End Begin TextBox Text5 Height = 372 Left = 2040 TabIndex = 3 Text = "170" Top = 360 Width = 612 End Begin TextBox Text4 Height = 372 Left = 960 TabIndex = 2 Text = "10" Top = 360 Width = 612 End Begin TextBox Text3 Height = 372 Left = 240 TabIndex = 1 Text = "10" Top = 360 Width = 612 End Begin TextBox Text2 Height = 372 Left = 6240 TabIndex = 10 Text = "c:\windows\redbrick.bmp" Top = 3120 Width = 2652 End Begin TextBox Text1 Height = 372 Left = 1320 TabIndex = 8 Text = "c:\windows\leaves.bmp" Top = 3120 Width = 2652 End Begin CommandButton Command2 Caption = "Loadpicture" Height = 372 Left = 240 TabIndex = 9 Top = 3120 Width = 1092 End Begin CommandButton Command1 Caption = "Loadpicture" Height = 372 Left = 5160 TabIndex = 11 Top = 3120 Width = 1092 End Begin PictureBox Picture2 Height = 2052 Left = 5160 ScaleHeight = 135 ScaleMode = 3 'Pixel ScaleWidth = 247 TabIndex = 15 TabStop = 0 'False Top = 3480 Width = 3732 End Begin PictureBox Picture1 Height = 2052 Left = 240 ScaleHeight = 135 ScaleMode = 3 'Pixel ScaleWidth = 247 TabIndex = 14 TabStop = 0 'False Top = 3480 Width = 3732 End Begin Label Label8 Caption = "Label8" FontBold = 0 'False FontItalic = 0 'False FontName = "Courier" FontSize = 9.75 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 252 Left = 240 TabIndex = 23 Top = 1920 Width = 8652 End Begin Label Label7 Caption = "BitBlt Command" Height = 252 Left = 240 TabIndex = 22 Top = 1680 Width = 2772 End Begin Label Label6 Caption = "Destination" Height = 252 Left = 5160 TabIndex = 21 Top = 2880 Width = 1452 End Begin Label Label1 Caption = "Source" Height = 252 Left = 240 TabIndex = 20 Top = 2880 Width = 732 End Begin Label Label5 Caption = "Raster Operation" Height = 252 Left = 5520 TabIndex = 19 Top = 120 Width = 1932 End Begin Label Label4 Caption = "UpLeft of Source" Height = 252 Left = 3840 TabIndex = 18 Top = 120 Width = 1452 End Begin Label Label3 Caption = "Wid. && Ht. of Dest." Height = 252 Left = 2040 TabIndex = 17 Top = 120 Width = 1572 End Begin Label Label2 Caption = "UpLeft of Dest." Height = 252 Left = 240 TabIndex = 16 Top = 120 Width = 1332 End Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal XSrc As Integer, ByVal YSrc As Integer, ByVal dwRop As Long) As Integer Const BLACKNESS = &H42 Const DSTINVERT = &H550009 Const MERGECOPY = &HC000CA Const MERGEPAINT = &HBB0226 Const NOTSRCCOPY = &H330008 Const NOTSRCERASE = &H1100A6 Const PATCOPY = &HF00021 Const PATINVERT = &H5A0049 Const PATPAINT = &HFB0A09 Const SRCAND = &H8800C6 Const SRCCOPY = &HCC0020 Const SRCERASE = &H440328 Const SRCINVERT = &H660046 Const SRCPAINT = &HEE086 Const WHITENESS = &HFF0062 Dim k As Long Sub Combo1_Change () combos End Sub Sub Combo1_Click () combos End Sub Sub combos () Select Case combo1.ListIndex Case 0 k = BLACKNESS Case 1 k = DSTINVERT Case 2 k = MERGECOPY Case 3 k = MERGEPAINT Case 4 k = NOTSRCCOPY Case 5 k = NOTSRCERASE Case 6 k = PATCOPY Case 7 k = PATINVERT Case 8 k = PATPAINT Case 9 k = SRCAND Case 10 k = SRCCOPY Case 10 k = SRCERASE Case 12 k = SRCINVERT Case 13 k = SRCPAINT Case 14 k = WHITENESS End Select filllabel End Sub Sub Command1_Click () picture2 = LoadPicture(text2) End Sub Sub Command2_Click () picture1 = LoadPicture(text1) End Sub Sub Command3_Click () command5_click i% = BitBlt(picture2.hDC, Val(text3), Val(text4), Val(text5), Val(text6), picture1.hDC, Val(text7), Val(text8), k) End Sub Sub Command4_Click () command5_click picture1.DrawStyle = 0 picture1.DrawWidth = 2 picture1.Line (Val(text7), Val(text8))-(picture1.Width - 2, picture1.Height - 2), , B picture1.DrawWidth = 1 'picture1.Line (Val(text7) + Val(text5), Val(text8) + Val(text6))-(Val(text7) + Val(text5) + 5, Val(text8) + Val(text6) + 15) 'picture1.Line (Val(text7) + Val(text5), Val(text8) + Val(text6))-(Val(text7) + Val(text5) + 15, Val(text8) + Val(text6) + 5) 'picture1.Line (Val(text7) + Val(text5), Val(text8) + Val(text6))-(Val(text7) + Val(text5) + 20, Val(text8) + Val(text6) + 20) picture1.DrawStyle = 1 picture1.Line (Val(text7), Val(text8))-(Val(text7) + Val(text5), Val(text8) + Val(text6)), , B picture2.DrawStyle = 0 picture2.DrawWidth = 2 picture2.Line (Val(text3), Val(text4))-(Val(text3) + Val(text5), (Val(text4) + Val(text6))), , B End Sub Sub command5_click () picture1.Refresh picture2.Refresh End Sub Sub filllabel () Label8.Caption = "i% = BitBlt(Picture2.hdc, " & Format$(Val(text3), "0") & ", " & Format$(Val(text4), "0") & ", " & Format$(Val(text5), "0") & ", " & Format$(Val(text6), "0") & ", Picture1.hdc, " & Format$(Val(text7), "0") & ", " & Format$(Val(text8), "0") & ", " & combo1.List(combo1.ListIndex) & ")" End Sub Sub Form_Load () combo1.AddItem "BLACKNESS" combo1.AddItem "DSTINVERT" combo1.AddItem "MERGECOPY" combo1.AddItem "MERGEPAINT" combo1.AddItem "NOTSRCCOPY" combo1.AddItem "NOTSRCERASE" combo1.AddItem "PATCOPY" combo1.AddItem "PATINVERT" combo1.AddItem "PATPAINT" combo1.AddItem "SRCAND" combo1.AddItem "SRCCOPY" combo1.AddItem "SRCERASE" combo1.AddItem "SRCINVERT" combo1.AddItem "SRCPAINT" combo1.AddItem "WHITENESS" combo1.ListIndex = 10 k = SRCCOPY filllabel End Sub Sub magicmarker (a As TextBox) a.SelStart = 0 a.SelLength = Len(a) End Sub Sub Text1_GotFocus () magicmarker text1 End Sub Sub Text2_GotFocus () magicmarker text2 End Sub Sub Text3_Change () filllabel End Sub Sub Text3_GotFocus () magicmarker text3 End Sub Sub Text4_Change () filllabel End Sub Sub Text4_GotFocus () magicmarker text4 End Sub Sub Text5_Change () filllabel End Sub Sub Text5_GotFocus () magicmarker text5 End Sub Sub Text6_Change () filllabel End Sub Sub Text6_GotFocus () magicmarker text6 End Sub Sub Text7_Change () filllabel End Sub Sub Text7_GotFocus () magicmarker text7 End Sub Sub Text8_Change () filllabel End Sub Sub Text8_GotFocus () magicmarker text8 End Sub